#ifndef __WIFIUTILS__H
#define __WIFIUTILS__H

#include <WiFi.h>

const char* ssid = "EA7_2.4G"; //wifi nane
const char* password = "exww6ii6"; // wifi password

String API = "http://106.12.111.47:8181/";

//-----------网络时间获取-----------//
const char* ntpServer = "pool.ntp.org"; //网络时间服务器
//时区设置函数，东八区（UTC/GMT+8:00）写成8*3600
const long gmtOffset_sec = 8 * 3600;
const int daylightOffset_sec = 0;   //夏令时填写3600，否则填0

void init_wifi() {
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }
    Serial.println("WiFi connected!");
    configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);

}

#endif